using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gameshield;
using System.IO;

namespace LicenseDecrypter
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 2) 
            {
                Console.WriteLine("Usage: decrypter.exe <<LicenseFile>> <<Password>>");
                return;
            }
            string licPath = args[0];
            string licPass = args[1];

            MemoryStream ms = GameshieldLicenseDecrypter.decryptLicense(licPath, licPass);

            File.WriteAllBytes(licPath + "_decrypted.bin", ms.ToArray());
            Console.WriteLine("License Decrypted!");
            Console.WriteLine("Decrypted File: " + licPath + "_decrypted.bin");
        }
    }
}
